<?php

/**
 * PasswordModification actions.
 *
 * @package    5
 * @subpackage PasswordModification
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class PasswordModificationActions extends sfActions
{
  public function executeModify(sfWebRequest $request)
  {
    $this->form = new PasswordModificationForm();
    if ($request->isMethod(sfRequest::GET))
    {

    }
    else if ($request->isMethod(sfRequest::PUT))
    {
      $this->form->bind($request->getParameter('password'));
      if ($this->form->isValid())
      {
        $this->getUser()->setPassword($this->form['password']->getValue());
        $this->redirect('@password?success=1');
      }
    }
  }
}
